<template>
	<view class="content">
			<view class="avatar">
					<view><u-avatar :src="baseUrl + 'images/static/home/man.png'"></u-avatar></view>
					<view class="login" v-if="!_id" @click="login">注册并登录</view>
					            <view class="login" v-else>{{ phoneNumber }}</view>
			
			</view>
			<!-- //我的订单/我的收藏 -->
			<view class="order">
				<view class="myorder" @click="myOrder">
					<image :src="baseUrl + 'images/static/center/Mask group@2x(1).png'" mode="" class="orderImg"></image>
					<view class="ordercontent">
						<image :src="baseUrl + 'images/static/center/Frame@2x(1).png'" mode="" class="icon"></image>
						<view class="myorder">我的订单</view>
					</view>
				</view>
				<view class="myorder" @click="myCollect">
					<image :src="baseUrl + 'images/static/center/Mask group@2x.png'" mode="" class="orderImg"></image>
					<view class="ordercontent">
						<image :src="baseUrl + 'images/static/center/Frame@2x.png'" mode="" class="icon"></image>
						<view class="myorder">我的收藏</view>
					</view>
				</view>
			</view>
			
			<!-- <view class="other">其它功能</view> -->
			<view class="cell">
				<u-cell-group>
					<u-cell-item icon="server-man" title="我是译员" :arrow="true" arrow-direction="right" @click="click" index='0'></u-cell-item>
					<u-cell-item icon="edit-pen" title="意见反馈" :arrow="true" arrow-direction="right" @click="click" index='1'></u-cell-item>
					<u-cell-item icon="chat-fill" title="关于我们" :arrow="true" arrow-direction="right" @click="click" index='2'></u-cell-item>
				</u-cell-group>
			</view>
	</view>
</template>

<script>
	import {
		request,
		baseUrl
	} from '../../http/request.js';
	export default {
		data() {
			return {
				baseUrl:baseUrl,
				 _id: null,
				 phoneNumber:'',
				 openid:'',
				   src: '/static/home/Ellipse 1@2x(1).png',
			}
		},
		onShow() {
			  this._id = uni.getStorageSync('_id');
			  this.phoneNumber = uni.getStorageSync('phoneNumber');
			 
		},
		  // onLoad() {
		  //           // 在组件被挂载后，从本地存储中获取 account 的值
		  //           this.account = uni.getStorageSync('account');
		  //       },
		methods: {
			click(e){
				console.log("e1:", e);
				switch (e){
					case "0":
						uni.navigateTo({
							url:'/pagesEditResume/editResume/editResume'
						})
						break;
					case "1":
						uni.navigateTo({
							url:'/pagesFeedback/Feedback/Feedback'
						})
						break;
					case "2":
					uni.navigateTo({
						url:'/pagesAboutUs/aboutUs/aboutUs'
					})
					default:
						break;
				}
				},
			uploadResume(){
				if(this.nickName){
					uni.navigateTo({
						url:'/pagesEditResume/editResume/editResume'
					})
				}else{
				uni.$u.toast("请先登录");
				}
				
			},
			//跳转我的订单
			myOrder(){
				uni.navigateTo({
						url:'/pagesMyOrder/myOrder/myOrder'
					})
				
			},
			//跳转收藏
				
			myCollect(){
				uni.navigateTo({
					url:'/pagesCollection/collection/collection'
				})
			},
			//跳转登录
			login(){
				uni.navigateTo({
					url:'/pagesLogin/register/login'
				})
			}
			
		}
	}
</script>

<style lang="scss">
	.order{
		width: 100%;
		display: flex;
		justify-content: space-evenly;
		margin-top: 40rpx;
		margin-bottom: 20rpx;
		.myorder{
			position: relative;
			.orderImg{
				width: 332rpx;
				height: 180rpx;
			
			}
		}
		.ordercontent{
			position: absolute;
			left: 120rpx;
			top:20rpx ;
			text-align: center;
			.icon{
				width: 80rpx;
				height: 80rpx;
				
			}
			.myorder{
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 28rpx;
				color: #FFFFFF;
			}
		}
	}
	.content{
		padding: 20rpx 20rpx;
	}
	.avatar{
		display: flex;
		align-items: center;
		margin-left: 30rpx;
	}
	.login{
		font-size: 35rpx;
		margin-left: 20rpx;
		font-weight: bold;
	}
	
	
	.cell{
		margin: 20rpx 20rpx;
		font-size: 30rpx;
		font-weight: bold;
	}
	.coll{
		margin-top: 20rpx;
	}
</style>
